home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / etc / dkms / template-dkms-mkdeb / debian / postinst < prev    next >
Text File  |  2009-08-21  |  1KB  |  54 lines

  1. #!/bin/sh
  2. # Copyright (C) 2002-2005 Flavio Stanchina
  3. # Copyright (C) 2005-2006 Aric Cyr
  4. # Copyright (C) 2007 Mario Limonciello
  5. # Copyright (C) 2009 Alberto Milone
  6.  
  7. NAME=MODULE_NAME
  8. PACKAGE_NAME=$NAME-dkms
  9. CVERSION=`dpkg-query -W -f='${Version}' $PACKAGE_NAME | awk -F "-" '{print $1}' | cut -d\: -f2`
  10.  
  11. ARCH=`dpkg --print-architecture`
  12. case $ARCH in
  13.     amd64)
  14.         ARCH="x86_64"
  15.                 ;;
  16.     lpia)
  17.         ARCH="i686"
  18.         ;;
  19.     i386)
  20.         ARCH="i686"
  21.         ;;
  22.     *)
  23.         echo "WARNING: unsupported arch: $ARCH"
  24.         ARCH="$ARCH"
  25.         ;;
  26. esac
  27.  
  28. case "$1" in
  29.     configure)
  30.         for POSTINST in /usr/lib/dkms/common.postinst /usr/share/$PACKAGE_NAME/postinst; do
  31.             if [ -f $POSTINST ]; then
  32.                 $POSTINST $NAME $CVERSION /usr/share/$PACKAGE_NAME $ARCH $2
  33.                 exit $?
  34.             fi
  35.             echo "WARNING: $POSTINST does not exist."
  36.         done
  37.         echo "ERROR: DKMS version is too old and $PACKAGE_NAME was not"
  38.         echo "built with legacy DKMS support."
  39.         echo "You must either rebuild $PACKAGE_NAME with legacy postinst"
  40.         echo "support or upgrade DKMS to a more current version."
  41.         exit 1
  42.     ;;
  43.  
  44.     abort-upgrade|abort-remove|abort-deconfigure)
  45.     ;;
  46.  
  47.     *)
  48.         echo "postinst called with unknown argument \`$1'" >&2
  49.         exit 1
  50.     ;;
  51. esac
  52.  
  53. #DEBHELPER#
  54.